import Router from 'koa-router'
import UserController from '../controller/user.controller'
import FileController from '../controller/file.controller'
import TestContoller from '../controller/test.controller'

const router = new Router({
  prefix: '/api'
})
router
  .get('/', (ctx, next) => {
    ctx.response.body = {
      name: 'hsj'
    }
  })
  .get('/test', TestContoller.test)
  .post('/register', UserController.register)
  .post('/login', UserController.login)
  .all('/user', UserController.user)
  .post('/upload', FileController.upload)

export default router
